package com.tao.util;

import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.tao.domain.SendMessage;
import com.tao.util.pack.BaseResponeBean;

public class Texts {
public static void main(String[] args) {
	String s= "{\"BaseResponse\": {\"Ret\": 0,\"ErrMsg\": \"\"},\"MsgID\": \"7893015359955544465\",\"LocalID\": \"1478148497024\"}";
	//String ret = new StringSubClass().subStringOne(s, "Ret\":", ",\"ErrMsg");
	String sx= "[{\"polName\":\"fdfdsf\",\"userNickName\":\"fsdf\",\"groupNickName\":\"fdfs\",\"content\":\"fdsfd\"},{\"polName\":\"fdfdsf\",\"userNickName\":\"fsdf\",\"groupNickName\":\"fdfs\",\"content\":\"fdsfd\"}]";
//	System.out.println(new Gson().fromJson(s, BaseResponeBean.class)); 
	
	SendMessage r = new SendMessage();
	r.setContent("fdsfd");
	r.setGroupNickName("fdfs");
	r.setPolName("fdfdsf");
	r.setUserNickName("fsdf");
	String df = new Gson().toJson(r);
	System.out.println(df);
	List<SendMessage> list = new  Gson().fromJson(sx, new TypeToken<List<SendMessage>>() { }.getType());
	System.out.println(list.get(0).getPolName());
//	
//	System.out.println("@6e7ca48b719cba4ccea6b89fbae051add92b01f0a28c1fc874a696fcfa85fd9a".equals("@2802d5349a06405aad3a894a5ca2b282cd594c928b8db5f8e40b3e498f36d4a3"));
//	
}
}
